$(function () {
    $("#from1").ajaxForm({
        dataType: 'json',
        type: 'post',
        beforeSubmit: ajaxSubmit,
        success: ajaxSuccess,
        error: ajaxError
    });

    $("body").click(function () {
        $("#Msg").fadeOut(150);
    });
});
function ajaxSubmit() {

}
/*
 * 成功发送AJAX
 * 
 * @param Json
 * @returns {Boolean}
 */
function ajaxSuccess(Json) {
    $('#Msg').html(Json.Msg).fadeIn();
    //为空不跳转
    if (Json.Url != null) {
        window.location.href = Json.Url;
    }
}

function ajaxError() {
    $('#Msg').html('操作错误!').fadeIn().fadeOut(2000);
    return true;
}

/*
 * 浏览器上传插件
 * 
 * @returns {Boolean}
 */
function CKupdate() {
    for (instance in CKEDITOR.instances)
        CKEDITOR.instances[instance].updateElement();
    return true;
}

/**
 * 跳转页面
 * 
 * @param url
 * @returns {Boolean}
 */
function jump(url) {
    if (url == null) {
        return false;
    }

    window.location.href = url;
    return false;
}

/**
 * 删除
 * 
 * @param src
 */
function del(src) {
    if (src == null) {
        return false;
    }

    $.ajax({
        type: 'POST',
        url: src,
        dataType: 'json',
        data: null,
        beforeSend: ajaxSubmit,
        success: ajaxSuccess,
        error: ajaxError
    });

    return false;
}